package ${servicePackageName}.mapstruct;

import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;
import org.mapstruct.factory.Mappers;

import ${servicePackageName}.entity.sys.SysDepartment;
import ${servicePackageName}.qo.sys.DepartmentReq;

/**
 * 部门转各种dto,vo
 * @author lizihao
 *
 */
@Mapper
public interface DepartmentConverMapper {
	DepartmentConverMapper INSTANCES = Mappers.getMapper(DepartmentConverMapper.class);
	
	/**
	 * source是指被复制的对象的属性名,target是复制后对象的属性\
	 * 如果被复制和复制的对象属性名都相同,可以不用配置mapping
	 * @param req
	 * @return
	 */
	@Mappings({
        @Mapping(source = "id", target = "id"),
        @Mapping(source = "departmentName", target = "departmentName"),
        @Mapping(source = "isEnable", target = "isEnable"),
        @Mapping(source = "parentDepId", target = "parentDepId")
	})
	SysDepartment departmentReqToSysDepartment(DepartmentReq req);
}
